package com.nfit.shopcommon.exception;

import com.nfit.shopmodel.vo.common.ResultCodeEnum;
import lombok.Data;


/**
 * ClossName:GuiguException
 * Pakage:org.nfIt.common.exception
 * Description
 *
 *
 * 自定义异常类
 *
 * @Author L
 * @Create 2024/11/15 19:55
 */
@Data
public class CustomException extends RuntimeException {
    /**
     * 响应状态码
     */
    private Integer code;
    /**
     * 响应提示信息
     */
    private String message;

    /**
     * 枚举响应
     */
    private ResultCodeEnum resultCodeEnum;

    public CustomException(ResultCodeEnum resultCodeEnum) {
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();
        this.resultCodeEnum = resultCodeEnum;
    }
}
